package com.insyte.adapters;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.insyte.R;
import com.insyte.fragments.ProfileFavourisFragment;
import com.insyte.fragments.ProfileInfoFragment;
import com.insyte.fragments.ProfilePhotoFragment;
import com.insyte.utils.NonSwipeableViewPager;

/**
 * Created by Administrator on 25/03/2015.
 */
public class ProfilePagerAdapter extends FragmentStatePagerAdapter {
    private NonSwipeableViewPager viewPager;
    public ProfilePagerAdapter(FragmentManager fm, NonSwipeableViewPager viewPager) {
        super(fm);
        this.viewPager = viewPager;
    }
    private static final int TOTAL_PAGE = 3;

    @Override
    public Fragment getItem(int position) {
        Fragment fragment = null;
        switch (position) {
            case 0:
                fragment = new ProfileInfoFragment().setViewPager(viewPager);
                break;
            case 1:
                fragment = new ProfileFavourisFragment().setViewPager(viewPager);;
                break;
            default:
                fragment = new ProfilePhotoFragment().setViewPager(viewPager);
                break;
        }
        return fragment;
    }

    @Override
    public int getCount() {
        return TOTAL_PAGE;
    }
}
